1. Field of the Invention
The present invention relates to data storage devices with flash memory and flash memory control methods.
2. Description of the Related Art
Flash memory, a data storage medium, is common in today's data storage devices. For example, a flash memory is typically used in memory cards, USB flash devices, solid-state drives, and so on. In another application with multi-chip package technology, a NAND flash chip and a controller chip are combined in one package as an embedded MultiMediaCard (eMMC).
A flash memory provides a storage space which is divided into blocks, and each block includes a plurality of pages. An erase operation is performed on a block basis. To release the space of one block, the entire block has to be erased. The blocks with excessively high erase counts are typically marked as bad blocks which are run down and in bad condition. The more bad blocks, the fewer spare blocks available in the flash memory. When the number of spare blocks is less than a lower limit, the flash memory is write protected, readable but not writable.